package org.txazo.blog.commons.parser;

/**
 * ParserFactory
 * 
 * @author Tu XiaoZhou
 * @since 2013-10-22
 * 
 */
public class ParserFactory {

	public static final int PARSER_TYPE_CSS = 1;
	public static final int PARSER_TYPE_HTML = 2;
	public static final int PARSER_TYPE_JAVA = 3;
	public static final int PARSER_TYPE_SHELL = 4;
	public static final int PARSER_TYPE_XML = 5;

	private ParserFactory() {
	}

	public static Parser getParser(String input, String output, int type) {
		Parser parser = null;
		if (type == PARSER_TYPE_JAVA) {
			parser = new JavaParser(input, output);
		} else if (type == PARSER_TYPE_SHELL) {
			parser = new ShellParser(input, output);
		}
		return parser;
	}

	public static void main(String[] args) {
		Parser parser = ParserFactory.getParser("D:/1.txt", "D:/2.txt",
				ParserFactory.PARSER_TYPE_JAVA);
		parser.parse();
	}

}
